﻿using SqlSugar;

namespace Shop.Model.Entity.Jur;

/// <summary>
/// 6.1 用户
/// </summary>
[SugarTable("jur_user")]
public class JurUser: BaseEntity
{
    /// <summary>
    /// 账号
    /// </summary>
    public string Account { get; set; }

    /// <summary>
    /// 密码
    /// </summary>
    public string PassWord { get; set; }
    
    /// <summary>
    /// 头像
    /// </summary>
    public string Head { get; set; }

    /// <summary>
    /// 用户名
    /// </summary>
    public string Name { get; set; }

    /// <summary>
    /// 性别
    /// 1:男
    /// 2 :女
    /// </summary>
    public int Sex { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    [SugarColumn(IsOnlyIgnoreInsert = true)]      
    public DateTime CreateTime { get; set; }

    /// <summary>
    /// 状态
    /// -1 删除
    /// 0 正常
    /// 1 冻结
    /// </summary>
    public int State { get; set; }

    /// <summary>
    /// 更新时间
    /// </summary>
    public DateTime? UpdateTime { get; set; }

    /// <summary>
    /// 角色
    /// </summary>
    [Navigate(NavigateType.OneToMany, nameof(JurUserRole.UserId))]
    public List<JurUserRole> UserRoles { get; set; }
}